using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_HotTVMiddleware_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.HotTVMiddleware);
            args = new Type[]{};
            method = type.GetMethod("Create", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Create_0);
            args = new Type[]{typeof(huqiang.UIComposite.TreeViewItem), typeof(huqiang.UIComposite.TreeViewNode)};
            method = type.GetMethod("Update", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Update_1);

            field = type.GetField("Context", flag);
            app.RegisterCLRFieldGetter(field, get_Context_0);
            app.RegisterCLRFieldSetter(field, set_Context_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_Context_0, AssignFromStack_Context_0);
            field = type.GetField("creator", flag);
            app.RegisterCLRFieldGetter(field, get_creator_1);
            app.RegisterCLRFieldSetter(field, set_creator_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_creator_1, AssignFromStack_creator_1);
            field = type.GetField("caller", flag);
            app.RegisterCLRFieldGetter(field, get_caller_2);
            app.RegisterCLRFieldSetter(field, set_caller_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_caller_2, AssignFromStack_caller_2);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIComposite.HotTVMiddleware());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.HotTVMiddleware[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* Create_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.HotTVMiddleware instance_of_this_method = (huqiang.UIComposite.HotTVMiddleware)typeof(huqiang.UIComposite.HotTVMiddleware).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Create();

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* Update_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.TreeViewNode @dat = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.TreeViewItem @obj = (huqiang.UIComposite.TreeViewItem)typeof(huqiang.UIComposite.TreeViewItem).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.UIComposite.HotTVMiddleware instance_of_this_method = (huqiang.UIComposite.HotTVMiddleware)typeof(huqiang.UIComposite.HotTVMiddleware).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Update(@obj, @dat);

            return __ret;
        }


        static object get_Context_0(ref object o)
        {
            return ((huqiang.UIComposite.HotTVMiddleware)o).Context;
        }

        static StackObject* CopyToStack_Context_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.HotTVMiddleware)o).Context;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance, true);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method, true);
        }

        static void set_Context_0(ref object o, object v)
        {
            ((huqiang.UIComposite.HotTVMiddleware)o).Context = (System.Object)v;
        }

        static StackObject* AssignFromStack_Context_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Object @Context = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.HotTVMiddleware)o).Context = @Context;
            return ptr_of_this_method;
        }

        static object get_creator_1(ref object o)
        {
            return ((huqiang.UIComposite.HotTVMiddleware)o).creator;
        }

        static StackObject* CopyToStack_creator_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.HotTVMiddleware)o).creator;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_creator_1(ref object o, object v)
        {
            ((huqiang.UIComposite.HotTVMiddleware)o).creator = (System.Func<huqiang.UIComposite.TreeViewItem>)v;
        }

        static StackObject* AssignFromStack_creator_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Func<huqiang.UIComposite.TreeViewItem> @creator = (System.Func<huqiang.UIComposite.TreeViewItem>)typeof(System.Func<huqiang.UIComposite.TreeViewItem>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((huqiang.UIComposite.HotTVMiddleware)o).creator = @creator;
            return ptr_of_this_method;
        }

        static object get_caller_2(ref object o)
        {
            return ((huqiang.UIComposite.HotTVMiddleware)o).caller;
        }

        static StackObject* CopyToStack_caller_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.HotTVMiddleware)o).caller;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_caller_2(ref object o, object v)
        {
            ((huqiang.UIComposite.HotTVMiddleware)o).caller = (System.Action<huqiang.UIComposite.TreeViewItem, huqiang.UIComposite.TreeViewNode>)v;
        }

        static StackObject* AssignFromStack_caller_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Action<huqiang.UIComposite.TreeViewItem, huqiang.UIComposite.TreeViewNode> @caller = (System.Action<huqiang.UIComposite.TreeViewItem, huqiang.UIComposite.TreeViewNode>)typeof(System.Action<huqiang.UIComposite.TreeViewItem, huqiang.UIComposite.TreeViewNode>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((huqiang.UIComposite.HotTVMiddleware)o).caller = @caller;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.UIComposite.HotTVMiddleware();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
